#include<iostream>

using namespace std;

const float PI = 3.14;

class shape {

public:

    shape() {}

    virtual float get_area()

    {

        return PI;

    }

};

class rectangle :public shape {

public:

    rectangle(float x, float y) {

        a = x; b = y;

    }

    float get_area();

private:

    float a, b;

};

float rectangle::get_area() {

    return a * b;

}



class circle : public shape {

public:

    circle(float x) { r = x; }

    float get_area();

private:

    float r;

};

float circle::get_area() {

    return (PI * r * r);

}

int main() {

    rectangle r(3, 4);

    circle c(2);

    shape* p[2] = { &r,&c };

    for (int i = 0; i < 2; i++)

        cout << p[i]->get_area() << endl;

    return(0);

}